
// store of the span element for show a debug message
var spandebug;

/**
 * show a debug message str: showed string add: save a previous string
 */
function setDebugMessage(str, add){
    if (null == spandebug) {
        return;
    }
    add = typeof(add) != 'undefined' ? add : true;
    if (add) {
        var old = spandebug.innerText || spandebug.textContent;
        if (old && old.length > 0) {
            str = old + ",  " + (str);
        }
    }
    spandebug.innerText = spandebug.textContent = '' + str;
}

function debugInit(){
    spandebug = document.getElementById("spandebug");
}

addEvent(window, 'load', debugInit)

